/*
    Bandleader
    Copyright (c) 2006 by Grant Yoshida

    Licensed under the GPL version 2 or later,
    please see COPYING for details.
*/

#ifndef Cursor_h
#define Cursor_h

#include <QtCore/QObject>

class CursorHost;

class Cursor : public QObject
{
    Q_OBJECT
public:
    Cursor(CursorHost *host);

    void moveUp();
    void moveDown();
    void moveLeft();
    void moveRight();

    bool canMoveUp() const;
    bool canMoveDown() const;
    bool canMoveLeft() const;
    bool canMoveRight() const;

    void setPos(int row, int col);

    int row() const;
    int col() const;

    int index() const;

signals:
    void cursorMoved();

private:
    int numRows() const;
    int numCols() const;

private:
    CursorHost *m_host;
    int m_row;
    int m_col;
};

//

inline int Cursor::row() const
{
    return m_row;
}

inline int Cursor::col() const
{
    return m_col;
}

#endif
